<?php

if(!defined('_HTML_MENU_FLOAT_')) {
define('_HTML_MENU_FLOAT_', 1);

function flep_html_menu_float($links, $href, $title = false) {

  echo '<div class="float_menu">';
  if($title) {
    echo "<label><a href='$href.php'>$title</a></label>\n";
  }
  foreach($links as $page => &$name) {
    printf('<a href="%s.php?page=%s">%s</a>', $href, $page, $name);
  }
  echo '</div>';
}

function flep_html_menu_float_extra($links, $href, $page, $get ,$title = false) {

  echo '<div class="float_menu">';
  if($title) {
    echo "<label><a href='$href.php?page=$page'>$title</a></label>\n";
  }
  foreach($links as $id => &$name) {
    printf('<a href="%s.php?page=%s&%s=%s">%s</a>', $href, $page, $get, $id, $name);
  }
  echo '</div>';
}

function flep_html_menu_search(&$info) {

  echo "<h3>".$info['menu_title']."</h3>";
  ?>
  <br>
  <div class="menu">
  <?php 
    foreach($info['menu_items'] as &$item) {
      echo $item.'&nbsp;|&nbsp;';
    }
    flep_html_search($info['search_page']);
  ?>
  </div>
  <br>
  <?php
  flep_html_message();
}

function flep_html_menu_get($type, $id, $field, $url, $page, $get, $title = false, $where = false){

  $links = array();
  flep_structure($struct, $type);
  if($where){
    $struct['where'][0] = $where;
  }
  if(flep_search_all($struct)){
    foreach($struct['data'] as $item) {
      $links[flep_encode($item[$id])] = $item[$field];
    }
  }
  echo $struct['msg'];
  flep_html_menu_float_extra($links, $url, $page, $get, $title);
}

}
?>
